# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Dan Serban
# Contributor: Federico Chiacchiaretta

pkgname=transmageddon
pkgver=1.5
pkgrel=10
pkgdesc='Simple python application for transcoding video into formats supported by GStreamer'
arch=('any')
url='http://www.linuxrising.org/'
license=('LGPL')
depends=('gst-plugins-base' 'gst-python' 'gtk3' 'libnotify' 'python-gobject')
makedepends=('intltool')
optdepends=('gst-plugins-good: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'            
            'gst-libav: Extra media codecs')
source=("http://www.linuxrising.org/files/$pkgname-$pkgver.tar.xz"
        '0001-Specify-required-versions-of-GI-components.patch'
        '0001-Remove-the-usage-of-deprecated-xml.etree.ElementTree.patch'
        '0001-Fix-AppStream-metadata-validation.patch')
sha256sums=('ca24369a94ce4edc992c1c7b3e2d09d7cd82794ce4c1b862a1a83ea40121e296'
            'b705242aae648a2554754880fb1c48d5415febe769a986df177b9792a6aefd27'
            '7c127931f777d6655bf1323a7fd190b1b557a42bedb02017fa03d6afeee32b7a'
            'ca16192de33f8694a74220c3790a230d32c5576c663a34db050e0c2db9b0e002')

prepare() {
  cd $pkgname-$pkgver

  # Fix run with Python 3.9
  patch -Np1 -i ../0001-Remove-the-usage-of-deprecated-xml.etree.ElementTree.patch

  # Fix run when GTK 4 is installed
  patch -Np1 -i ../0001-Specify-required-versions-of-GI-components.patch

  # Fix AppStream metadata validation
  patch -Np1 -i ../0001-Fix-AppStream-metadata-validation.patch
  sed -i 's|${datadir}/appdata|${datadir}/metainfo|' configure{,.ac}
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
